var gulp = require('gulp');
var less = require("gulp-less");
var auto=require("gulp-autoprefixer");
// var concat=require("gulp-concat");
var bs=require("browser-sync");


gulp.task('default',["lessc","watch","serve"]);

gulp.task("lessc",function(){
    gulp.src("src/less/*.less")
    .pipe(less())
    .pipe(auto({
        browsers:["last 2 versions"]
    }))
    .pipe(gulp.dest("src/css"))
    .pipe(bs.reload({stream:true}));
})

gulp.task("watch",function(){
    gulp.watch("src/less/*.less",["lessc"]);
    // gulp.watch("src/css/*.css",["concat"]);
    gulp.watch("src/html/myinfo.html",bs.reload);
})

gulp.task("serve",function(){
    bs.init({
        server:{
            port:"9999",
            baseDir:"./"
        },
        startPath:"src/html/myinfo.html"
    })
})


// gulp.task("concat",function(){
//     gulp.src("src/css/*.css")
// })